﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace LonCanvas
{
    public interface ICanvas
    {
        IModel DataModel { get; }
        UnitPoint ScreenTopLeftToUnitPoint();
        UnitPoint ScreenBottomRightToUnitPoint();
        void SetDefaultCenter();
        PointF ToScreen(UnitPoint unitpoint);
        float ToScreen(double unitvalue);
        double ToUnit(float screenvalue);
        UnitPoint ToUnit(PointF screenpoint);
        void Invalidate();
        IDrawObject CurrentObject { get; }
        Rectangle ClientRectangle { get; }
        Graphics Graphics { get; }
        Pen CreatePen(Color color, float unitWidth);
        void DrawLine(Pen pen, UnitPoint p1, UnitPoint p2);
        void DrawArc( Pen pen, UnitPoint center, float radius, float beginangle, float angle);
        void DrawCircle(Pen pen, UnitPoint center, float radius);

        void DrawRectangle( Pen pen, UnitPoint center, float XRadius, float yRadius);
        void DrawLinePath(Pen pen, UnitPoint[] points);
        void FillEllipse(Brush brush, UnitPoint center, float xRadius, float yRadius);
        void DrawText(Brush brush, UnitPoint location, StringAlignment alignent, float height,float angle);

         bool IsPointInLine(UnitPoint m_p1, UnitPoint m_p2, UnitPoint point, float thWidth);
    }
}
